package com.gengzp.mq.client.tools.impl;

import com.gengzp.mq.client.tools.MqEnvironmentVariableReader;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import static com.gengzp.mq.client.constants.MqRequestUrlConstants.HTTP_REQUEST_PREFIX;

/**
 * @ClassName MqEnvironmentVariableReaderImpl
 * @Description 消息队列环境变量读取器实现类
 * @Author gengzp
 * @Date 2025/9/4 17:45
 */
@Component
public class MqEnvironmentVariableReaderImpl implements MqEnvironmentVariableReader {

    /**
     * mq消息队列服务实例ip
     */
    @Value("${gengzp-mq.host:}")
    private String mqHost;

    /**
     * mq消息队列服务实例端口号
     */
    @Value("${gengzp-mq.port:}")
    private String mqPort;

    @Override
    public String getMqAddress() {
        return HTTP_REQUEST_PREFIX + mqHost + ":" + mqPort;
    }

}
